/**
 * 
 */
package com.yangtao.prototype.system.user.web;

import com.yangtao.framework.web.BaseAction;
import com.yangtao.prototype.system.user.service.UserModel;
import com.yangtao.prototype.system.user.service.UserService;

/**
 * @author 杨涛
 * 
 */
public class UserAction extends BaseAction<UserModel, UserService> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public String query() {
		// request.setAttribute("companyList", service.getCompanys(getUser()
		// .getCompanyId()));
		// list();
		return render("UserQuery");
	}

	public String save() {
		service.save(model);
		return renderJsonMessage();
	}

	public String load() {
		service.load(model);
		service.loadPracticableResource(model);
		return render("UserDetail");
	}

	public String delete() {
		service.delete(model);
		return renderJsonMessage();
	}

	public String list() {
		service.list(model);
		renderJson(model.getPage());
		return null;
	}

	public void prepare() {
		service.load(model);
	}
}
